#ifndef BASE_H
#define BASE_H

class Base {
public:
  void pub_mem();

protected:
  int pro_mem();

private:
  char pri_mem();
};

struct Pub_derv : public Base {
  int f() { return pro_mem(); }

  //错误，私有成员不可访问
  // char g() { return pri_mem(); }
};
struct Pri_derv : private Base {
  int f1() { return pro_mem(); }

  //错误，私有成员也不可访问
  // char g1() { return pri_mem(); }
};
struct Pro_derv : protected Base {
  int f2() { return pro_mem(); }

  //错误，私有成员也不可访问
  // char g3() { return pri_mem(); }
};

struct Derivated_from_Public : public Pub_derv {
  int use() { return pro_mem(); }
};
struct Derivated_from_Protected : public Pro_derv {
  int use() { return pro_mem(); }
};
struct Derivated_from_Private : public Pri_derv {
  //错误，不可访问
  // int use() { return pro_mem(); }
};
#endif // BASE_H